#include "Deprecated.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* Deprecated_classType = NULL;
VTable* Deprecated_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Void make(|Deprecated->Void|? f) */
void Deprecated_make_0(Deprecated* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Deprecated.make not implemented yet"));
}


/* Void make(|Deprecated->Void|? f) */
void Deprecated_make(Deprecated* self, Func* f)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Deprecated.make not implemented yet"));
}


/* Str msg */
Str* Deprecated_msg(Deprecated* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::Deprecated.msg not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* Deprecated_initType(void)
{
  if (Deprecated_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = Deprecated_initVTable();
    Type* type = Type_new("Deprecated", baseType, vtable, sizeof(Deprecated), sizeof(DeprecatedVTable));
    Type_registerCtorImplementation(type, "make", Deprecated_make_0, 0);
    Type_registerCtorImplementation(type, "make", Deprecated_make, 1);
    Type_registerFieldImplementation(type, "msg", Deprecated_msg, NULL);
    Deprecated_classType = type;
    Deprecated_initStatic();
  }
  return Deprecated_classType;
}


VTable* Deprecated_initVTable(void)
{
  if (Deprecated_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(DeprecatedVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    Deprecated_classVTable = vtable;
  }
  return Deprecated_classVTable;
}


void Deprecated_initStatic(void)
{
}
